widget: Only check display debug flags if the global ones are set
authorTimm Bäder <mail@baedert.org>
Sat, 14 Oct 2017 05:37:06 +0000 (07:37 +0200)
committerTimm Bäder <mail@baedert.org>
Sat, 14 Oct 2017 05:37:06 +0000 (07:37 +0200)
commitec18661bbb19f98f7fab3e6360379f892bc4dd92
tree22cc504d1d9b66ef615ec5770e921c9aaac4a29e
parenteee335557c0e4043edd53e8c33ccc23de3dd19ef
widget: Only check display debug flags if the global ones are set

The gtk_widget_get_display call in this if statement is showing up in
profiles. It ends up walking up the hierarchy to the toplevel to get its
GdkScreen, etc. so it is relatively costly. Avoid that call in most
cases by first checking if the RESIZE debugging is enabled for any of
the displays and only then checking if it is enabled for the widget's
display.
gtk/gtkwidget.c